function instance = m2instance(m,ind)
% Gets one instance out of Big Matrix

NameOfFields = fieldnames(m);
instance = [];
for ii = 1:length(NameOfFields)
    TempField = getfield(m,NameOfFields{ii});
    if numel(TempField) == 1
        instance = setfield(instance,NameOfFields{ii},TempField);
    else
        instance = setfield(instance,NameOfFields{ii},TempField(ind));
    end
end

end
